package main

import (
	"errors"
	"fmt"
)

func getCirclaArea(r float32) (area float32, err error) {
	if r < 0 {
		err = errors.New("半径不对")
		return
	}
	area = 3.14 * r * r
	return
}

func main() {
	area, err := getCirclaArea(-1)
	if err != nil {
		fmt.Println("错误")
	}
	fmt.Println(area)
}
